#include("../../comm/FormHead.html")
<style>
    .input-center{ text-align:center }
</style>
<div id="main">
    <form action="" class="layui-form  margin-10" lay-filter="form">
        <input type="hidden" id="actions" name="actions" value="#(form.actions)">
        <input type="hidden" id="test_slider" name="test_slider" value="#(test.test_slider)">
        #(token??)

        <div class="layui-row">
            <div class="layui-col-md12">
                <div class="layui-form-item">
                    <label class="layui-form-label">测试ID</label>

                    <div class="layui-input-block">
                        <input type="text" readonly name="test_id" placeholder="自动生成" value="#(test.test_id)" class="layui-input input-readonly">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-row">
            <div class="layui-col-md12">
                <div class="layui-form-item">
                    <label class="layui-form-label">测试名称</label>

                    <div class="layui-input-inline" style="width:150px">
                        <input type="text" id="test_name" name="test_name" placeholder="请输入测试名称"
                               value="#(test.test_name)" class="layui-input">
                    </div>
                    <div class="layui-input-inline" style="width:70px">
                        <input type="text" class="layui-hide" lay-skin="mynumber" autocomplete="off" value="#(test.test_number)" step="0.01" name="test_number">
                    </div>
                    <div class="layui-input-inline" style="width:70px">
                        <input type="text" class="layui-hide" lay-skin="mynumber" value="#(test.test_number2)" name="test_number2">
                    </div>
                    <div class="layui-input-inline" style="width:150px">
                        <input type="text" url="getTestTreeApi" class="layui-input layui-hide" lay-skin="mytreeselect" value="grade12" placeholder="请选择节点">
                    </div>
                    <div class="layui-input-inline" style="width:150px">
                        <input type="text" url="getTestTreeApi" class="layui-input layui-hide" id="treeselect1" value="5" placeholder="请选择节点">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-row">
            <div class="layui-col-md12">
                <div class="layui-form-item">
                    <label class="layui-form-label">标题</label>

                    <div class="layui-input-inline">
                        <input type="text" id="test_title" name="test_title" placeholder="请输入标题"
                               value="#(test.test_title)" class="layui-input">
                    </div>

                    <div class="layui-input-inline" style="width:90px">
                        <input lay-skin="mycolor" name="test_color" value="#(test.test_color)" class="layui-hide"/>
                    </div>
                    <div class="layui-input-inline" style="width:90px">
                        <input lay-skin="mycolor" name="test_color2" value="#(test.test_color2)" class="layui-hide"/>
                    </div>
                    <div class="layui-input-inline" style="width:200px">
                        <input type="text" lay-skin="myicon" name="test_icon2" value="#(test.test_icon2)" class="layui-hide">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-row">
            <div class="layui-col-md12">
                <div class="layui-form-item">
                    <label class="layui-form-label">发布时间</label>

                    <div class="layui-input-inline" style="width:160px">
                        <input type="text" id="pub_date" name="pub_date" placeholder="请选择发布时间" autocomplete="off"
                               value="#(test.pub_date_str)" class="layui-input">
                    </div>
                    <div class="layui-input-inline vvv" style="width:200px;border:3px;padding-top:18px">
                        <div id="slider1"></div>
                    </div>

                </div>
            </div>
        </div>
        <div class="layui-row">
            <div class="layui-col-md12">
                <div class="layui-form-item">
                    <label class="layui-form-label">测试路经</label>

                    <div class="layui-input-inline" style="width:300px">
                        <input type="text" name="test_url" placeholder="请输入测试路经"
                               value="#(test.test_url)" class="layui-input">
                    </div>
                    <div class="layui-input-inline" style="width:300px;height:38px;">
                        <div id="test_rate"></div>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-row">
            <div class="layui-col-md12">
                <div class="layui-form-item">
                    <label class="layui-form-label">图片</label>

                    <div class="layui-input-inline">
                        <input type="text" lay-skin="myupload" class="layui-hide" width="110" height="60" btn_class="layui-btn-xs btn-change-8"
                               name="test_img" view_path="#(test.test_img_view)" value="#(test.test_img)"/>
                    </div>
                    <div class="layui-input-inline" style="width:220px">
                        <input id="up1" type="text" lay-skin="myupload" class="layui-hide" url="UploadImages"
                               width="110" height="60" view_path="#(test.test_img2_view)"
                               btn_txt="上传(120*60)" btn_class="layui-btn-xs btn-change-13"
                               size="300" accept="images" exts="jpg|png|gif"
                               name="test_img2" value="#(test.test_img2)"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-row">
            <div class="layui-col-md12">
                <div class="layui-form-item">
                    <label class="layui-form-label">备注</label>

                    <div class="layui-input-block">
                        <textarea name="test_desc" placeholder="请输入备注" class="layui-textarea" style="height:60px">#(test.test_desc)</textarea>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button type="submit" class="layui-btn" lay-submit="" lay-filter="Submit1">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
</div>
<SCRIPT LANGUAGE="JavaScript">
    <!--
    var test_slider = 0;
    layui.use('laydate', function () {
        layui.laydate.render({elem: '#pub_date', type: 'datetime', format: 'yyyy-MM-dd HH:mm:ss'});
    });
    layui.use(['form', 'myTool'], function () {
        layui.form.on('submit(Submit1)', function (data) {
            layui.myTool.postJson("ModifyTestTableApi", data.field, function () {
                parent.layer.closeAll();
            });
            return false;
        });
    });
    layui.use(['rate'], function () {
        ins1 = layui.rate.render({
            elem: '#test_rate'  //绑定元素
        });
    });

    layui.use(['slider'], function () {
        silder1 = layui.slider.render({
            elem: '#slider1', max: 100, input: true, value: layui.$("#test_slider").val()
            , change: function (value) {
                layui.$("#test_slider").val(value);
            }
        });
    });


    layui.use(['myNumber', 'myUpload', 'myColor', 'myIcon'], function () {
        layui.myNumber.render({readonly: true, min: 1, max: 5, step: 2});
        layui.myUpload.render({btn_class: "layui-btn-sm btn-change-13", btn_txt: '上传'});
        layui.myColor.render({});
        layui.myIcon.render({});
    });


    layui.use(['myTreeSelect'], function () {
        var treeSelect = layui.myTreeSelect;

        var datas =
                [{
                    "children": [
                        {"title": "留言列表", "text": "留言列表", "id": 5, "turn": true},
                        {"title": "发表留言", "text": "发表留言", "id": 6, "turn": true}
                    ],
                    "title": "评论(无法选择)", "text": "评论", "id": 4, "turn": false
                }];

        treeSelect.render({});
        // 初始化下拉选择器
        treeSelect.render({
            elem: '#treeselect1',
            data: datas,
            height: 200,
            init: '5',
            click: function (d) {
                console.log(d);
            }
        });
    });
    //-->
</SCRIPT>
</body>
</html>